//
//  ViewController.m
//  CoreMotion
//
//  Created by yao zhaofeng on 2018/8/20.
//  Copyright © 2018年 YaoZhaofeng. All rights reserved.
//
//该模块实例，为网上查找，链接如下
//https://github.com/1102210843/SYCompassDemo
//https://github.com/Stanbai/sensorDemo
//

#import "ViewController.h"
#import <CoreMotion/CoreMotion.h>
#import "ViewController1.h"
#import "ViewController2.h"

@interface ViewController ()

@property (nonatomic, strong) CMMotionManager *motionManager;
@property (nonatomic, assign) CGPoint point;
@property (nonatomic, weak) UIView *horizontalView;
@end

@implementation ViewController

- (instancetype)init {
    if (self = [super init]) {
        
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
   
    NSStringEncoding encoding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
    char *cc = "\262\273\271\375\325\342һ";
    NSString *str = [NSString stringWithCString:"\262\273\271\375\325\342һ" encoding:encoding];
    NSLog(@"str === %@", str);
}


- (IBAction)btnClick:(UIButton *)btn {
    switch (btn.tag) {
        case 1:
            //
        {
            ViewController1 *vc = [[ViewController1 alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        
        case 2:
            //
        {
            ViewController2 *vc = [[ViewController2 alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 3:
            //
        {
            NSURL *url = [NSURL URLWithString:@"weixin://"];
            if ([[UIApplication sharedApplication] canOpenURL:url]) {
                [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
                    
                }];
            }
        }
            break;
        default:
            break;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
